package com.eastfair.certificate.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperCacheService;
import com.eastfair.boot.service.SuperService;
import com.eastfair.certificate.dto.CertificateIndexDTO;
import com.eastfair.certificate.entity.CertificateIndex;
import com.eastfair.certificate.vo.CertificateIndexVO;
import com.eastfair.core.base.R;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 业务接口
 * 证件指标设置
 * </p>
 *
 * @author ligang
 * @date 2022-07-22
 */
public interface CertificateIndexService extends SuperCacheService<CertificateIndex> {


    /**
     * 分页查询
     *
     * @param params
     * @return
     */
    IPage<CertificateIndexVO> pageVo(PageParams<CertificateIndexDTO> params);

    /**
     * 组装信息
     *
     * @param certificateIndexVOList
     */
    void assembleData(List<CertificateIndexVO> certificateIndexVOList);

    /**
     * do转vo
     *
     * @param model
     */
    CertificateIndexVO doToVo(CertificateIndex model);

    /**
     * do转vo
     *
     * @param modelList
     */
    List<CertificateIndexVO> doToVos(List<CertificateIndex> modelList);

    QueryWrapper<CertificateIndex> assembleQueryWrapper(CertificateIndexDTO certificateIndexDTO);
    /**
     * 通用查询
     *
     * @param modelDTO DTO
     * @param ids      主键id集合
     * @return list
     */
    List<CertificateIndex> list(CertificateIndexDTO modelDTO, List<Long> ids);

    /**
     * 通用查询
     *
     * @param modelDTO DTO
     * @param ids      主键id集合
     * @return list
     */
    List<CertificateIndex> listOfCache(CertificateIndexDTO modelDTO, List<Long> ids);

    /**
     * 校验指标
     * @param certificateId
     * @param spaceCode
     * @param comeTime
     * @return
     */
    Boolean verifyIndex(Long certificateId, String spaceCode, LocalDateTime comeTime);

    /**
     * 添加或减少指标
     *
     * @param certificateId
     * @param spaceCode
     * @return
     */
    Boolean addIndex(Long certificateId, String spaceCode, LocalDateTime comeTime,Integer num);
}
